package com.fpost.ajax;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.json.JSONObject;

public class TextResult implements Result {

    private String result;

    public TextResult(String result) {
        this.result = result;
    }

    public void applyResult(HttpServletRequest request, HttpServletResponse response) throws Exception {
        response.addHeader("Content-Type", "text/plain");
        response.getOutputStream().write(result.getBytes("UTF-8"));
        response.getOutputStream().flush();
    }
}
